package com.demo.aop.aspect;

import java.util.Arrays;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order(1) // 定义切面优先级 数字越小 级别越高
@Component
@Aspect
public class ValidateAspectjProxy {
	// LoggingAspectjProxy 不同包前面要加包名
	@Before("LoggingAspectjProxy.declareJoinPointExpresson()")
	public void validateMethod(JoinPoint joinpoint) {
		String name = joinpoint.getSignature().getName();
		System.out.println("ValidateAspectjProxy: " + name + "--args:" + Arrays.asList(joinpoint.getArgs()));

	}
}
